/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2022-08-19
 * Time: 15:06
 */

interface IRun{
    void run();
    //接口中得方法为抽象方法，且不需要方法体
}

interface ISwim{
    void swim();
}

//两栖动物既可以跑也可以游泳
interface  IAmphibious extends IRun,ISwim{

}

class Alligator implements IAmphibious{
    private String name;

    public Alligator(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println(this.name+"既可以用腿跑");
    }

    @Override
    public void swim() {

        System.out.println(this.name+"又可以用腿游泳");
    }
}
public class Test_0819 {

    public static void Test(Alligator a ){
        a.run();
        a.swim();
    }

    public static void main(String[] args) {

        Alligator alligator = new Alligator("鳄鱼");
        alligator.run();
        alligator.swim();
    }

}
